export default defineNuxtRouteMiddleware((to, from) => {
    const nuxtApp = useNuxtApp();
    const {getSetting} = useStores.setting();
    const {getClassifyData} = useStores.classify();
    const {getMenus} = useStores.menu();
    const {getToken} = useUtils().AuthUtils;
    const {token} = useStoreToRefs(useStores.user());
    const {setUserInfo} = useStores.user();
    // 初始化全局设置
    getSetting();
    // 初始化全局菜单
    getMenus();
    // 初始化全局分类
    getClassifyData();
    // 检查是否登录
    if (getToken() || token.value) {
        // 初始化用户信息
        setUserInfo();
    }
});